package me.wsj.fengyun

import android.app.Application
import me.wsj.fengyun.utils.SpUtils
import me.wsj.lib.BaseApp.Companion.context
import me.wsj.lib.utils.SpUtil
import me.wsj.plugin_lib.SkinManager

object MyAppUtils {


    fun okSplash(): Boolean {
        return SpUtils.getBoolean(SpUtils.KEY_AGREE, false)
    }

    fun init(app: Application) {
        SkinManager.init(app, object : SkinManager.OnPluginCallback {
            override fun setSkin(skinPath: String?) {
                SpUtil.setPluginPath(context, skinPath)
            }

            override fun reset() {
                SpUtil.setThemeFlag(context, 0)
            }

            override fun getSkin(): String {
                return SpUtil.getPluginPath(context)
            }
        })

    }
}